/*
 * my_counter.h
 *
 *  Created on: 2009-9-9
 *      Author: lius
 */

#ifndef MY_COUNTER_H_
#define MY_COUNTER_H_

#define MY_COUNTER_RECV 		1
#define MY_COUNTER_SEND 		1 << 1
#define MY_COUNTER_CONNED		1 << 2
#define MY_COUNTER_ALL			0XFFFFFFFF



#define _COUNTER

#ifdef _COUNTER
#define PRINT_MY_COUNTER(counter_name, count, units)\
do {\
	fprintf(stderr, "\n*************  [%s]  COUNTER*************\n               [%lu](%s)\n", counter_name, count, units);\
	fprintf(stderr, "\n");\
}while(0)

#define START_PRINT fprintf(stderr, "\n-------------------------------------------------------------------------------")
#define END_PRINT fprintf(stderr, "-------------------------------------------------------------------------------\n")

#else
#define PRINT_MY_COUNTER(counter_name, count, units)
#endif







inline void update_my_recv_bytes(int n);
inline void update_my_send_bytes(int n);
inline void update_my_conn_ested(int n);
inline void print_my_counter(unsigned int counters);


#endif /* MY_COUNTER_H_ */
